package cn.kgc.ffzw.test;

public class Truck extends Car {
    Integer luntai=3;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    String name="卡车";

    public Integer getLuntai() {
        return luntai;
    }

    public void setLuntai(Integer luntai) {
        this.luntai = luntai;
    }

    public Truck() {
    }

    public Truck(Integer apeed, Integer state) {
        super(apeed, state);
    }

    @Override
    public void run() {
        System.out.println(this.getName()+"的平均速度为"+super.getSpeed());
        System.out.println(this.getName()+"轮胎减少"+this.getLuntai()+"个后，平均速度为："
                +(super.getSpeed()-this.getLuntai()*3));
        System.out.println("行驶10000米使用了"+10000/(super.getSpeed()-this.getLuntai()*3)+"秒");
    }
}
